package com.hnkywl.sts.service.cwgl;

import com.hnkywl.sts.dao.cwgl.KhzhsfmxDao;
import com.hnkywl.sts.entity.cwgl.Khzhsfmx;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-3-25
 * Time: 下午3:38
 * To change this template use File | Settings | File Templates.
 */
@Service
public class KhzhsfmxService {
    private KhzhsfmxDao khzhsfmxDao;
    /**
     * 保存开户行信息
     *
     * @param khzhsfmx 开户行明细实体
     * @return
     */
    @Transactional
    public void saveKhzhsfmx(Khzhsfmx khzhsfmx) {
        this.khzhsfmxDao.save(khzhsfmx);
    }



    @Transactional
    public void deleteKhzhsfmx(List<Khzhsfmx> khzhsfmxList) {
        for(Khzhsfmx khzhsfmx : khzhsfmxList){
            khzhsfmx.setDeleted(1);
            khzhsfmx.setLastUpdated(new Date());
            this.khzhsfmxDao.save(khzhsfmx);
        }
    }

    @Autowired
    public void setKhzhsfmxDao(KhzhsfmxDao khzhsfmxDao) {
        this.khzhsfmxDao = khzhsfmxDao;
    }
}
